<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script src="https://unpkg.com/vue@next"></script>
<div id="app">
    <ul>
        <!-- Uncaught TypeError: item is undefined,原因是，当v-for和v-if作用于，v-if的执行优先级，高于v-for，所以v-if取不到v-for中的变量-->
        <!--  <li v-for="item in todos" v-if="!item.isComplete">{{item.message}}</li>-->

        <!-- 可改写成template       -->
        <template v-for="item in todos">
            <li v-if="!item.isComplete">{{item.message}}</li>
        </template>
    </ul>


</div>
<script>
    const vueOpt = {
        data() {
            return {
                todos: [{message: 'a', isComplete: true}, {message: 'b', isComplete: false}]
            }
        }
    }

    Vue.createApp(vueOpt).mount('#app')


</script>
</body>
</html>
